<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<ui:composition template="/template/padrao.xhtml">
	<ui:define name="breadcrumb">
		<c:set var="breadcrumbText" value="Administrativo >> Cadastro de Equipamentos"/>
	</ui:define>
	<ui:define name="conteudo">
		<h:messages styleClass="errorMessage" globalOnly="true" />
		<p:growl id="editar" showDetail="true" />
		<h:panelGroup layout="block" style="padding-top: 10px;">
			<p:dataTable id="turnos" var="item" value="#{cadastroTurnoMBean.listTurno}">
				<p:column headerText="ID">
					<h:outputText value="#{item.id}" />
				</p:column>
				<p:column headerText="Código">
					<h:outputText value="#{item.codigo}" />
				</p:column>
				<p:column headerText="Inicio">
					<h:outputText value="#{item.horaInicio}" converter="br.com.advance.automacao.web.converters.HourConverter"/>
				</p:column>
				<p:column headerText="Fim">
					<h:outputText value="#{item.horaFim}" converter="br.com.advance.automacao.web.converters.HourConverter"/>
				</p:column>
				<p:column headerText="Descrição">
					<h:outputText value="#{item.descricao}" />
				</p:column>
				<p:column headerText="Status">
					<h:outputText value="Ativo" rendered="#{item.ativo}"/>
					<h:outputText value="Inativo" rendered="#{!item.ativo}"/>
				</p:column>
				<p:column style="text-align: center;">
					<p:commandButton icon="ui-icon-pencil" title="Editar" actionListener="#{cadastroTurnoMBean.abreEdicaoTurno(item)}">
						<p:ajax event="dialogReturn" listener="#{cadastroTurnoMBean.concluiEdicaoTurno}" update="@form" />
					</p:commandButton>
				</p:column>
			</p:dataTable>
			 <h:panelGroup layout="block"
				style="text-align: right; margin-top: 5px; padding-bottom: 3px; width: 100%;">
				<p:commandButton actionListener="#{cadastroTurnoMBean.abreInclusaoTurno()}" value="Novo">
					<p:ajax event="dialogReturn" listener="#{cadastroTurnoMBean.concluiEdicaoTurno}" update="@form" />
				</p:commandButton>
			</h:panelGroup>
        </h:panelGroup>
	</ui:define>
</ui:composition>
</html>